<include file="Public/header"/>

<div class="x-nav">
      <span class="layui-breadcrumb">

      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ&#xe615;</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" >
          <div class="layui-input-inline">
            <select name="quyu_id">
              <option value="0" <php>if(I("quyu_id")==0) echo 'selected' </php>>线路选择</option>
              <foreach name="info" item="v">
              	<option value="{$v.id}" <if condition='$v["id"] eq $quyu_id'>selected</if>   >{$v.name}</option>
              </foreach>
            </select>
          </div>        
          <div class="layui-input-inline">
            <select name="status">
              <option value="0">小区状态</option>
              <option value="1" <php>if(I('status') == 1) echo 'selected'</php>>正常</option>

              <option value="2" <php>if(I('status') == 2) echo 'selected'</php>>禁用</option>
            </select>
          </div>


          <input type="text" name="name"  value="{:I('name')}" placeholder="请输入小区名称" autocomplete="off" class="layui-input">
		  <input type="text" name="tuan_name"  value="{:I('tuan_name')}" placeholder="请输入团长姓名" autocomplete="off" class="layui-input">
		  <input type="text" name="mobile"  value="{:I('mobile')}" placeholder="请输入团长手机号" autocomplete="off" class="layui-input">
		  <input type="text" name="tuan_nickname"  value="{:I('tuan_nickname')}" placeholder="请输入团长昵称" autocomplete="off" class="layui-input">

          <button class="layui-btn" id="search"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
          <button class="layui-btn" id="export"  lay-submit="" lay-filter="" ><i class="layui-icon">&#xe62f;</i>导出</button>

        </form>
      </div>
      <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加小区','{:U('add')}')"><i class="layui-icon"></i>添加</button>

        <span class="x-right" style="line-height:40px">共有数据：{$count} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>

            <th>小区ID</th>
            <th>小区名称</th>
            <th width=130>自提点名称</th>
            <th>纬度</th>
            <th>经度</th>
            <th>地址</th>
            <th>状态</th>
            <th>线路</th>
            <th>团长姓名</th>
            <th>联系方式</th>
            <th>创建时间</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
          <tr>

            <td>{$vo['id']}</td>
            <td>{$vo['name']}</td>
            <td>{$vo['shopname']}</td>
            <td>{$vo['lat']}</td>
            <td>{$vo['lng']}</td>
            <td>{$vo['address']}</td>
            <td>
              <switch name="vo['status']">
                 <case value="1">正常</case>
                 <case value="2">禁用</case>
              </switch>
            </td>
            <td>
            {$vo['quyu_id']}
            </td>            
            <td>
            {$vo['tuan_name']}
            </td>
            <td>
            {$vo['mobile']}
            </td>
          <td>
            {$vo['addtime']|date="Y/m/d H:i",###}
          </td>

            <td class="td-manage">



              <a title="编辑" class="layui-btn layui-btn-xs"  onclick="x_admin_show('编辑','{:U('edit',array('id'=>$vo['id']))}')" href="javascript:;">
                编辑
              </a>

              <a title="删除"  class="layui-btn layui-btn-warm layui-btn-xs" onclick="single_del(this,'{$vo['id']}','{:U('del')}')" href="javascript:;">
                删除
              </a>
            </td>
          </tr>
          <if condition="$vo['children']">
            <volist name="vo['children']" id="val">
              <tr>
                <td>{$val['id']}</td>
                <td>┗━{$val['name']}</td>
                <td>{$val['desc']}</td>

                <td><img src="{$val['icon']}"style="width: 40px"></td>


                <td class="td-manage">




                  <a title="编辑" class="layui-btn layui-btn-xs"  onclick="x_admin_show('编辑','{:U('edit',array('id'=>$val['id']))}')" href="javascript:;">
                    编辑
                  </a>

                  <a title="删除"  class="layui-btn layui-btn-warm layui-btn-xs" onclick="single_del(this,'{$val['id']}','{:U('del')}')" href="javascript:;">
                    删除
                  </a>
                </td>
              </tr>
            </volist>

          </if>
        </volist>


        </tbody>
      </table>
      <div class="page" id="page">
        {$page}
      </div>

    </div>
    <script>
    $(function () {
        var searchurl = "{:U('index')}";
        $('#search').click(function () {

            $('form').attr('action',searchurl);
        });

        var exporturl = "{:U('exportorder')}";
        
        $('#export').click(function () {

            $('form').attr('action',exporturl);
        });
    })
    </script>

<include file="Public/footer"/>

